﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Touch2Like.Model;
using Touch2Like.DAL;
using System.Data;
using Touch2Like.SharedLibrary;

namespace Touch2Like.Web.Product
{
    public partial class ReturnCustomer : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
            }
            catch
            { }
        }

        protected void btn_Signin_Click(object sender, EventArgs e)
        {
            Touch2Like.DAL.UserDAL user = new Touch2Like.DAL.UserDAL();
            UserInfo info = user.GetUserByNameAndEmail(GlobalManager.RetrieveUserType.Email, tb_Email.Text.Trim());

            if (info != null)
            {
                if (tb_Password.Text.Trim() == Utility.Encryption.Decrypt(info.Password))
                {
                    WebUtility.UserGUID = info.UserGuid.ToString();
                    Response.Redirect("/Product/CheckOut.aspx?OrderID=" + Request["OrderID"]);
                    return;
                }
            }

            lb_Msg.Text = "Invalid username or password.";
        }
    }
}